package livingarea.other;

import livingarea.Members.Position;

/**
 *
 * @author Muzalevskiy Vitaliy
 */
public class Coordinates {
    public static final int DEFAULT_LENGTH = 30;
    public static final int DEFAULT_HEIGHT = 30;
    /**Quantity of directions in which all beasts can move. */
    public static final Direction[] DIRECTIONS = Direction.values();
    /** Quantity of parts in area by length.*/
    private int length;
    /**Quantity of parts in area by height.*/
    private int height;
    
    public Coordinates(){
        length = DEFAULT_LENGTH;
        height = DEFAULT_HEIGHT;
    }
    
    public Coordinates(int length, int height){
        this.length = length;
        this.height = height;
    }

    /**
     * @return the length
     */
    public int getLength() {
        return length;
    }

    /**
     * @return the height
     */
    public int getHeight() {
        return height;
    }

    public int getDirectionCount() {
        return DIRECTIONS.length;
    }          

    public Position setMemberPosition(){
        int x = (int)(new Random().getRandomValue(length));
        int y = (int)(new Random().getRandomValue(height));
        return new Position(x, y);
    }
}
